<template>
    <div>
        <a-drawer title="输入数据" size="large" placement="right" v-if="open" v-model:visible="open">
            <div>
                <a-form :model="params" name="basic" :label-col="{ span: 10 }">
                    <a-row>
                        <a-col :span="12">
                            <a-form-item label="井名" name="wellId" :rules="[{ required: true, message: '请输入井名' }]">
                                <a-input v-model:value="params.wellId" style="width: 200px" placeholder="请输入井名" />
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row>
                        <a-col :span="12">
                            <a-form-item label="开钻日期" name="drillingDate">
                                <a-date-picker v-model:value="params.drillingDate" format="YYYY-MM-DD" style="width: 200px"
                                    placeholder="开钻日期" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="完钻日期" name="completionDate">
                                <a-date-picker v-model:value="params.completionDate" format="YYYY-MM-DD"
                                    style="width: 200px" placeholder="完钻日期" />
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row>
                        <a-col :pull="4" :span="20">
                            <a-form-item label="地理位置" name="wellLocation">
                                <a-input v-model:value="params.wellLocation" style="width: 550px"></a-input>
                            </a-form-item>
                        </a-col>
                        <a-col :pull="4" :span="20">
                            <a-form-item label="构造位置" name="wellConstruct">
                                <a-input v-model:value="params.wellConstruct" style="width: 550px"></a-input>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row>
                        <a-col :span="12">
                            <a-form-item label="钻井设备" name="drillingEquipment">
                                <a-select v-model:value="params.drillingEquipment" style="width: 200px">
                                    <a-select-option v-for="item of drillingEquipment" :value="item" :key="item">
                                        {{ item }}</a-select-option>
                                </a-select>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="钻具扣型" name="drillToolType"
                                :rules="[{ required: true, message: '请选择钻具扣型' }]">
                                <buckle-type-select style="width: 200px" :buckleType="buckleType"
                                    @confirm="getBuckleType"></buckle-type-select>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="钻具最大外径(mm)" name="maxDrillingOuterDiameter"
                                :rules="[{ required: true, message: '请输入钻具最大外径' }]">
                                <a-input-number v-model:value="params.maxDrillingOuterDiameter" style="width: 200px"
                                    :min="0" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="地层岩性" name="lithology">
                                <lithology-select style="width: 200px" @confirm="getLithology"></lithology-select>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="井径(mm)" name="wellDiameter" :rules="[{ required: true, message: '请输入井径' }]">
                                <a-input-number v-model:value="params.wellDiameter" style="width: 200px" :min="0" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="造斜点(m)" name="obliquePointDeep">
                                <a-input v-model:value="params.obliquePointDeep" style="width: 200px" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="卡点井斜(°)" name="pointWellSlope">
                                <a-input-number v-model:value="params.pointWellSlope" style="width: 200px" :min="0" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="卡点方位(°)" name="pointWellLocation">
                                <a-input v-model:value="params.pointWellLocation" style="width: 200px"></a-input>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="狗腿度(°)" name="stuckPointsDoglegDegree">
                                <a-input v-model:value="params.stuckPointsDoglegDegree" style="width: 200px"></a-input>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="增/降斜点1(m)" name="riseDeclinePoint1">
                                <a-input v-model:value="params.riseDeclinePoint1" style="width: 200px"></a-input>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="井斜1(°)" name="wellSlope1">
                                <a-input v-model:value="params.wellSlope1" style="width: 200px"></a-input>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="方位1(°)" name="azimuth1">
                                <a-input v-model:value="params.azimuth1" style="width: 200px"></a-input>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="狗腿度1(°)" name="doglegDegree1">
                                <a-input v-model:value="params.doglegDegree1" style="width: 200px" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="增/降斜点2(m)" name="riseDeclinePoint2">
                                <a-input v-model:value="params.riseDeclinePoint2" style="width: 200px"></a-input>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="井斜2(°)" name="wellSlope2">
                                <a-input v-model:value="params.wellSlope2" style="width: 200px"></a-input>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="方位2(°)" name="azimuth2">
                                <a-input v-model:value="params.azimuth2" style="width: 200px" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="狗腿度2(°)" name="dogleg_degree2">
                                <a-input style="width: 200px" v-model:value="params.dogleg_degree2" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="电缆型号" name="cableModel">
                                <a-button style="width: 200px" @click="openToolModal('cable')">{{ buttonCable }}</a-button>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="电缆投产日期" name="putDate">
                                <a-date-picker v-model:value="params.putDate" format="YYYY-MM-DD" style="width: 200px"
                                    placeholder="投产日期" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="拉力测试日期" name="tensileTestDate">
                                <a-date-picker v-model:value="params.tensileTestDate" format="YYYY-MM-DD"
                                    style="width: 200px" placeholder="拉力测试日期" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="电缆接头" name="cableGlands">
                                <a-input v-model:value="params.cableGlands" style="width: 200px" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="仪器串信息" name="combination"
                                :rules="[{ required: true, message: '请选择仪器串信息' }]">
                                <a-button style="width: 200px" @click="openToolModal('combination')">{{ buttonCombination
                                }}</a-button>
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="仪器弱点" name="instrumentWeaknesses">
                                <a-input style="width: 200px" v-model:value="params.instrumentWeaknesses" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="仪器抓捞位置" name="salvagePosition">
                                <a-input style="width: 200px" v-model:value="params.salvagePosition" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="最小抗拉伸力(lbf)" name="minTensileResistance">
                                <a-input-number style="width: 200px" v-model:value="params.minTensileResistance" :min="0" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="最小抗压缩力(lbf)" name="minCompressiveForces">
                                <a-input-number style="width: 200px" v-model:value="params.minCompressiveForces" :min="0" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="马笼头" name="bridle">
                                <a-button style="width: 200px" @click="openToolModal('bridle')">{{ buttonbridle
                                }}</a-button>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row>
                        <a-col :pull="3" :span="20">
                            <a-space v-for="(drill, index) in dynamicValidateForm.drills" :key="drill.id"
                                style="display: flex; " align="baseline">
                                <a-form-item label="钻头程序" :name="['drills', index, 'depth']">
                                    <a-input-group style="width: 500px" compact>
                                        <a-input-number v-model:value="drill.outerDiameter" class="site-input-right"
                                            style="width: 160px; text-align: center" placeholder="外径(mm)" :min="0"
                                            addon-after="mm" />
                                        <a-input v-model:value="value13" class="site-input-split"
                                            style="width: 30px; pointer-events: none" placeholder="~" disabled />
                                        <a-input style="width: 160px;" v-model:value="drill.deep"
                                            placeholder="请输入钻头深度范围"></a-input>
                                    </a-input-group>
                                </a-form-item>
                                <a-form-item>
                                    <a-button style="width: 100px; margin-left: 70px"
                                        v-if="dynamicValidateForm.drills.length > 1" class="dynamic-delete-button"
                                        :disabled="dynamicValidateForm.drills.length === 1" type="dashed" block
                                        @click="removeDrills(drill)">
                                        <MinusCircleOutlined />删除行
                                    </a-button>
                                </a-form-item>
                            </a-space>
                        </a-col>
                        <a-button type="dashed" style="width: 70%; margin-left: 110px;" block @click="addDomain()">
                            <PlusOutlined />添加钻头程序
                        </a-button>
                    </a-row>
                    <a-divider dashed />
                    <a-row>
                        <a-col :pull="3" :span="20">
                            <a-form-item label="其它说明" name="otherNotes">
                                <a-textarea v-model:value="params.otherNotes" style="width: 600px" :rows="3" />
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row>
                        <a-col :span="12">
                            <a-form-item label="联系方式" name="phoneNumber">
                                <a-input style="width: 200px" v-model:value="params.phoneNumber" />
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-form-item label="填报单位" name="unit">
                                <a-input style="width: 200px" v-model:value="params.unit" />
                            </a-form-item>
                        </a-col>
                    </a-row>
                </a-form>
                <a-divider />
                <a-button type="primary" style="width: 100%;" @click="getSubmit">提交</a-button>

                <!-- 钻头选择弹窗 -->
                <AntdConfirmModal title="钻头选择" ref="bitModalRef" width="700px" :keepSlot="false"
                    @confirm="addTool('drill')">
                    <drill-bit-popup></drill-bit-popup>
                </AntdConfirmModal>
                <!-- 电缆选择弹窗 -->
                <AntdConfirmModal title="电缆选择" ref="cableModalRef" width="1000px" :keepSlot="false"
                    @confirm="addTool('cable')">
                    <cable-popup-page></cable-popup-page>
                </AntdConfirmModal>
                <!-- 选择仪器串推荐组合弹窗 -->
                <AntdConfirmModal :showConfirm="false" title="仪器串选择" ref="combinationModalRef" width="1200px">
                    <instrument-combination-radio
                        @combSuggestSelection="combSuggestSelection"></instrument-combination-radio>
                </AntdConfirmModal>
                <!-- 马笼头选择弹窗 -->
                <AntdConfirmModal title="马笼头选择" ref="bridleModalRef" width="1000px" :keepSlot="false"
                    @confirm="addTool('bridle')">
                    <bridle-popup-page></bridle-popup-page>
                </AntdConfirmModal>
            </div>
        </a-drawer>
    </div>
</template>
<script setup>
import { ref } from 'vue';
import { updateOne, createOne } from "@/api/salvage/threadCard.js";
import GeoLithology from '@/api/geo/lithology.js'
import WellBuckle from '@/api/tool/buckleType.js'
import WellCombination from "@/api/tool/combination.js";
import { queryList } from "@/api/salvage/accidentAlert";
import WellCable from "@/api/tool/cable.js";
import { drillingEquipment } from '@/custom/salvage/constant/report.js'
import InstrumentCombinationRadio from "@/custom/preTest/pages/plan/components/instrument/type/CombRadio.vue";
import { WellDatas } from '@/custom/salvage/constant/address.js'  //新建井判断
import BuckleTypeSelect from '@/custom/salvage/components/buckleTypeSelect.vue';
import DrillBitPopup from "@/custom/well/components/DrillBitPopup.vue";
import LithologySelect from '@/custom/salvage/components/LithologySelect'
import CablePopupPage from '@/custom/well/components/CablePopupPage'
import BridlePopupPage from '@/custom/well/components/BridlePopupPage'
import dayjs from 'dayjs'
import "dayjs/locale/zh-cn"
import "moment/locale/zh-cn"
import moment from "moment";
import useUserStore from '@/store/modules/user';
import useApp from "@/hooks";
const { $, proxy } = useApp();
const userStore = useUserStore();
const emit = defineEmits(["editData", 'deliverData'])
const props = defineProps({
    state: String,
    schemesData: Object
})
const dynamicValidateForm = reactive({
    drills: [],
});
const query = ref({ pageNum: 1, pageSize: 10, sortBy: 'id', searchKey: '' });
const params = reactive({
    wellId: '',
    azimuth1: '',
    azimuth2: "",
    cableGlands: "",
    cableId: "",
    combinationId: '',
    completionDate: "",
    stuckPointsDoglegDegree: '',
    doglegDegree1: '',
    dogleg_degree2: "",
    drillList: [],
    drillToolType: [],
    drillingDate: '',
    drillingEquipment: '',
    fillDate: '',
    fillPerson: '',
    horseHeadFileId: '',
    horseHeadId: '',
    // instrumentLength: 0,
    instrumentWeaknesses: '',
    lithology: '',
    // maxOuterDiameter: 0,
    maxDrillingOuterDiameter: 0,
    minCompressiveForces: 0,
    minTensileResistance: 0,
    obliquePointDeep: '',
    otherNotes: '',
    phoneNumber: '',
    pointWellLocation: '',
    pointWellSlope: '',
    putDate: '',
    riseDeclinePoint1: '',
    riseDeclinePoint2: '',
    salvagePosition: '',
    tensileTestDate: '',
    unit: '',
    wellDiameter: 0,
    wellSlope1: '',
    wellSlope2: '',
    wellConstruct: '',
    wellLocation: '',
});
const buttonCable = ref("选择电缆");
const buttonCombination = ref("选择仪器串");
const buttonbridle = ref("选择马笼头");
const open = ref(false)
const bitModalRef = ref(null);
const cableModalRef = ref(null);
const combinationModalRef = ref(null);
const bridleModalRef = ref(null);
// const combSuggesQuery = ref({}); //仪器串相关信息
const buckleType = ref([]) //存储扣型
watch([() => props.state, () => props.schemesData], ([newState, newSchemesData]) => {
    // console.log('watch state:', newState);
    // console.log('watch schemesData:', newSchemesData);
    getReportQuery()
}, { deep: true })

// 打开工具弹窗
function openToolModal(e) {
    console.log('openToolModal', e);
    if (e == 'drill') {
        bitModalRef.value.openModal()
    } else if (e == 'cable') {
        cableModalRef.value.openModal()
    } else if (e == 'bridle') {
        bridleModalRef.value.openModal()
    } else if (e == 'combination') {
        combinationModalRef.value.openModal()
    }
}

// 获取岩性列表
function getLithology(e) {
    GeoLithology.getOne(e).then(res => {
        params.lithology = res.lithologyName
    })
}
// 获取扣型列表
function getBuckleType(e) {
    // console.log('扣型列表', e);
    params.drillToolType = []
    e.forEach((item) => {
        WellBuckle.getOne(item).then(res => {
            params.drillToolType.push(res);
        })
    });
    // console.log('扣型列表', params.drillToolType);
}
// 添加一个钻头
const addDomain = () => {
    dynamicValidateForm.drills.push({
        outerDiameter: null,
        deep: null,
        name: `钻头${dynamicValidateForm.drills.length + 1}`,
        id: Date.now(),
    });
};
// 移除一个钻头
const removeDrills = (item) => {
    let index = dynamicValidateForm.drills.indexOf(item);
    if (index !== -1) {
        dynamicValidateForm.drills.splice(index, 1);
    }
};
// 数据设置
function setNewData(res) {
    dynamicValidateForm.drills = []
    for (const key in res) {
        if (res.hasOwnProperty(key) && params.hasOwnProperty(key)) {
            params[key] = res[key];
        }
    }
    // 处理钻头
    let drillStart = 0
    res.drillList?.forEach((e) => {
        dynamicValidateForm.drills.push({
            outerDiameter: e.outerDiameter,
            start: drillStart,
            deep: e.deep,
            name: e.name,
            id: e.deep,
        });
        drillStart = e.deep
    });
    console.log('setNewData', params);
    showCable(res?.cableId)
    showCombination(res?.combinationId)
}
// 方案数据读取
function getReportQuery() {
    console.log('state', props.state);
    if (props.state === "修改") {
        console.log('props.schemesData', props.schemesData);
        let type = []
        props.schemesData.drillToolType?.forEach((e) => {
            type.push(e);
        });
        buckleType.value = type
        console.log('buckleType.value', buckleType.value);
        setNewData(props.schemesData);
    } else if (props.state === "补充") {
        console.log('props.schemesData', props.schemesData)
        resetParams(params); //重置params对象
        // 测前方案的相同井信息赋值
        params.wellId = props.schemesData.wellId
        params.wellLocation = props.schemesData.wellLocation
        params.wellConstruct = props.schemesData.tectonicSetting
        // 查询事故快报列表是否存在该井
        queryList(query.value).then(res => {
            const foundObj = res.content.find(obj => {
                if (obj.wellId === params.wellId) {
                    return true; // 如果找到满足条件的对象，则返回 true
                }
            });
            if (foundObj) {
                console.log(`找到满足条件的对象:`, foundObj);
                params.cableId = foundObj.cableId
                params.combinationId = foundObj.combinationId
                params.obliquePointDeep = foundObj.obliquePointDeep
                showCable(params.cableId)
                showCombination(params.combinationId)
            } else {
                console.log(`没有满足条件的对象`);
            }
        })
    } else {
        resetParams(params); //重置params对象
    }
}
getReportQuery()

// 重置params对象
function resetParams(obj) {
    for (let key in obj) {
        if (Array.isArray(obj[key])) {
            console.log('重置params数组', obj[key]);
            obj[key] = []; // 清空数组
        } else if (typeof obj[key] === 'object' && obj[key] !== null) {
            resetParams(obj[key]); // 递归处理嵌套的对象
        } else {
            obj[key] = ''; // 重置属性
        }
    }
}
// 添加工具信息
function addTool(e) {
    console.log('addTool', e);
    if (e == 'cable') {
        let cableData = JSON.parse(localStorage.getItem('selectCables'))
        console.log('cableData', cableData);
        params.cableId = cableData[0].id
        showCable(cableData[0].id)
        cableModalRef.value.closeModal();
    } else if (e == 'bridle') {
        let bridleData = JSON.parse(localStorage.getItem('selectBridle'))
        console.log('bridleData', bridleData);
        params.horseHeadFileId = bridleData[0].fileId
        params.horseHeadId = bridleData[0].id
        buttonbridle.value = `${bridleData[0].horseheadId}`
        bridleModalRef.value.closeModal();
    }
    // else if (e == 'drill') {
    //     let drillData = JSON.parse(localStorage.getItem('selectdrill'))
    //     console.log('drillData', drillData);
    //     bitModalRef.value.closeModal();
    // }
}
// 添加仪器串
function combSuggestSelection(item) {
    console.log('combSuggestSelectio', item);
    params.combinationId = item.id
    //查询仪器串包含的仪器所有信息
    // getCombDetail(item.id).then((res) => {
    //     console.log(res);
    //     combSuggesQuery.value.loggingContent = [];
    //     combSuggesQuery.value.instrumentIdList = [];
    //     combSuggesQuery.value.totalLength = 0;
    //     combSuggesQuery.value.maxOuterDiameter = 0;
    //     combSuggesQuery.value.totalWeight = 0;
    //     // 查找是否含有马笼头
    //     res.forEach((e) => {
    //         // 如果有，将马笼头仪器参数名称与其他仪器参数名称统一
    //         if (e.hasOwnProperty("horseheadId")) {
    //             e.instrumentId = e.horseheadId;
    //             e.outerDiameter = e.maxDiameter;
    //             e.instrumentName = e.horseheadName;
    //             e.weight = 0;
    //         }
    //         //为新建仪器串推荐负载参数赋值
    //         combSuggesQuery.value.maxOuterDiameter =
    //             combSuggesQuery.value.maxOuterDiameter > e.outerDiameter ? combSuggesQuery.value.maxOuterDiameter : e.outerDiameter;
    //         combSuggesQuery.value.totalLength = combSuggesQuery.value.totalLength + e.length;
    //         combSuggesQuery.value.totalWeight = combSuggesQuery.value.totalWeight + e.weight;
    //         combSuggesQuery.value.instrumentIdList.push(e.id);
    //     });
    //     combSuggesQuery.value.instrumentCombination = item.instrumentNameList;
    //     combSuggesQuery.value.totalWeight = combSuggesQuery.value.totalWeight.toFixed(2);
    //     combSuggesQuery.value.totalLength = combSuggesQuery.value.totalLength.toFixed(2);
    //     // combSuggesQuery.value.schemeId = localStorage.getItem("schemeId");
    // });
    // console.log('combSuggesQuery', combSuggesQuery.value);
    showCombination(item.id)
    combinationModalRef.value.closeModal();
}
// 电缆信息展示
function showCable(id) {
    if (id) {
        WellCable.queryOne(id).then(res => {
            console.log(res);
            buttonCable.value = `已选择${res.diameter}mm的电缆`
        })
    } else {
        buttonCable.value = "选择电缆"
    }
}
// 仪器串信息展示
function showCombination(id) {
    if (id) {
        WellCombination.queryOne(id).then(res => {
            console.log(res);
            buttonCombination.value = `已选择${res.combinationName}`
        })
    } else {
        buttonCombination.value = "选择仪器串"
    }
}
// 提交
async function getSubmit() {
    params.drillList = dynamicValidateForm.drills;
    // params.instrumentLength = combSuggesQuery.value.totalLength
    // params.maxOuterDiameter = combSuggesQuery.value.maxOuterDiameter
    let currentTime = new Date()
    params.fillDate = moment(currentTime).format('YYYY-MM-DD')
    // 获取系统当前用户名
    const userRes = await userStore.getProfile();
    console.log('userRes', userRes);
    params.fillPerson = userRes.userName

    // 日期格式化
    if (params.drillingDate) { params.drillingDate = dayjs(params.drillingDate).format('YYYY-MM-DD') }
    if (params.completionDate) { params.completionDate = dayjs(params.completionDate).format('YYYY-MM-DD') }
    if (params.putDate) { params.putDate = dayjs(params.putDate).format('YYYY-MM-DD') }
    if (params.tensileTestDate) { params.tensileTestDate = dayjs(params.tensileTestDate).format('YYYY-MM-DD') }

    // 判空
    if (params.wellId == '' || params.wellId == undefined) { $.showToast({ title: '井名不允许为空', icon: 'warn' }) }
    else if (!params.cableId) { $.showToast({ title: '请选择电缆', icon: 'warn' }) }
    else if (!params.combinationId) { $.showToast({ title: '请选择仪器串', icon: 'warn' }) }
    else if (params.wellDiameter == 0) { $.showToast({ title: '请输入井径', icon: 'warn' }) }
    else if (params.maxDrillingOuterDiameter == 0) { $.showToast({ title: '请输入钻具最大外径', icon: 'warn' }) }
    else if (params.drillList.length == 0 ||
        params.drillList[params.drillList.length - 1].outerDiameter == null ||
        params.drillList[params.drillList.length - 1].deep == null) {
        $.showToast({
            title: '钻头数据不允许为空',
            icon: 'warn'
        })
    } else {
        console.log('params', params);
        if (props.state === '新建' || props.state === '补充') {
            createOne(params).then(res => {
                open.value = false
                $.showToast({
                    title: '新建成功',
                    icon: 'success'
                })
                console.log('createOne', res);
                emit('deliverData', res)
                WellDatas(res.id, res.wellId)
            })
        } else if (props.state === '修改') {
            params.id = props.schemesData.id
            updateOne(params).then(res => {
                $.showToast({
                    title: '修改成功',
                    icon: 'success'
                })
                open.value = false
                console.log('updateOne', res);
                emit('deliverData', res)
            })
        }
    }
}
function openDrawer() {
    open.value = true;
}
defineExpose({
    openDrawer: openDrawer
})
onMounted(() => {

})
</script>
<style scoped>
.steps-content {
    margin-top: 16px;
    border: 1px dashed #e9e9e9;
    border-radius: 6px;
    background-color: #fafafa;
    min-height: 200px;
    text-align: center;
    padding-top: 80px;
}


[data-theme='dark'] .steps-content {
    background-color: #2f2f2f;
    border: 1px dashed #404040;
}
</style>